﻿using PARK.Common.Const;
using PARK.Common.Entity;
using SqlSugar;
using System;
using Yitter.IdGenerator;

namespace PARK.System.Entitys.Permission
{
    /// <summary>
    /// 登录日志
    /// </summary>
    [SugarTable("base_user_loginlog")]
    [Tenant(ClaimConst.TENANT_ID)]
    public class UserloginlogEntity
    {
        /// <summary>
        /// Id
        /// </summary>
        [SugarColumn(ColumnName = "Id")]
        public string Id { get; set; }

        /// <summary>
        /// F_UserId
        /// </summary>
        [SugarColumn(ColumnName = "F_UserId")]
        public string UserId { get; set; }

        /// <summary>
        /// F_LoginAccount
        /// </summary>
        [SugarColumn(ColumnName = "F_LoginAccount")]
        public string LoginAccount { get; set; }

        /// <summary>
        /// F_IPAddress
        /// </summary>
        [SugarColumn(ColumnName = "F_IPAddress")]
        public string IPAddress { get; set; }

        /// <summary>
        /// LoginTime
        /// </summary>
        [SugarColumn(ColumnName = "F_LoginTime")]
        public DateTime LoginTime { get; set; }

        /// <summary>
        /// LoginRet
        /// </summary>
        [SugarColumn(ColumnName = "F_LoginRet")]
        public int LoginRet { get; set; }

        /// <summary>
        /// 创建
        /// </summary>
        public virtual void Create()
        {
            this.Id = YitIdHelper.NextId().ToString();
        }
    }
}
